import re

content = """
    白日依2025/08/13山尽，黄河入2025.08.13海流。
    欲穷08-13-2025千里目，更8/13/2025上一层楼。
"""

#收集好模式：1开头，总11位，3~9
pattern = r"(\d{4})/(\d{2})/(\d{2})"   #正则表达式规则
content = re.sub(pattern, r"\1-\2-\3", content)
print(content)

content = re.sub(r"(\d{4})\.(\d{2})\.(\d{2})", r"\1-\2-\3", content)
print(content)

content = re.sub(r"(\d{2})-(\d{2})-(\d{4})", r"\3-\1-\2", content)
print(content)

content = re.sub(r"(\d{1})/(\d{2})/(\d{4})", r"\3-0\1-\2", content)
print(content)